package com.cskaoyan.service;

import com.bean.User;
import com.cskaoyan.mapper.UserMapper;


import org.springframework.beans.factory.annotation.Autowired;

public class UserServiceImpl implements UserService{
    @Autowired
    UserMapper userMapper;

    public String queryNameById(Integer id){
        //sqlSession = MyBatisUtil.getSqlSession();
        //UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
        String s = userMapper.selectNameById(id);
        //sqlSession.commit();
        //sqlSession.close();
        return s;
    }

    @Override
    public int insertUser(User user) {
        //sqlSession = MyBatisUtil.getSqlSession();
        //UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
        int i = userMapper.insertUser(user);
        //sqlSession.commit();
        //sqlSession.close();
        return i;
    }


}
